<div>
    <select id="silk-permissions-add-user">
	<option value="" i18n:translate="string:Add User"/>
	<option tal:repeat="user this/users" tal:attributes="value user/user_id" tal:content="user/username"/>
    </select>
    <button id="silk-permissions-add-user-button" i18n:translate="string:Add"/>
</div>

<table id="silk-permissions-user-permissions">

    <thead>
	<tr>
	    <th i18n:translate="string:User" class="lalign"/>
	    <th tal:repeat="privilege privileges" tal:content="privilege" class="calign" />
	</tr>
    </thead>

    <tbody>
	<tr id="silk-permissions-default-user" style="display:none">
	    <td class="lalign">
		<input type="hidden" class="silk-permissions-hidden-user_id" value=""/>
		<span class="silk-permissions-username"/>
	    </td>
	    <td tal:repeat="privilege privileges" class="calign">
		<input type="checkbox" class="silk-permissions-privilege" tal:attributes="value privilege"/>
	    </td>
	</tr>
	<tr tal:repeat="user users">
	    <td class="lalign">
		<input type="hidden" class="silk-permissions-hidden-user_id" name="user_permissions[user][]" tal:attributes="value user/user_id"/>
		<span  class="silk-permissions-username" tal:content="user/username|default"/>
	    </td>
	    <td tal:repeat="privilege privileges" class="calign">
		<input type="checkbox" class="silk-permissions-privilege"  tal:attributes="name string:user_permissions[privilege][${user/user_id}][];value privilege;checked php:this.checked(this.hasPermission(array('resource' => resource, 'privilege' => privilege), user))"/>
	    </td>
	</tr>
    </tbody>

</table>